package com.heima.user.config;


import com.heima.user.interceptor.BvTokenInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author lzq
 * @data 2023/4/29 19:21
 */
@Configuration
public class WmMVCConfig implements WebMvcConfigurer {
    @Autowired
    private BvTokenInterceptor beTokenInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //注册自定义拦截器,拦截所有请求路径
        registry.addInterceptor(beTokenInterceptor).addPathPatterns("/**");
    }
}
